-
Notifications
You must be signed in to change notification settings - Fork 1k
Polish translation of cheatsheets page #630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thank you, I will make a review as soon as possible. |
I'll highly appreciate any feedback. |
You should also add link you your translation on other pages, not only on English one.
|
AFAIK there is no need. Edit: Bad for, link was to line 31, now 20. |
| ------ | ------ | | ||
| <span id="variables" class="h2">zmienne</span> | | | ||
| `var x = 5` | zmienna | | ||
| <span class="label success">Dobrze</span> `val x = 5`<br> <span class="label important">Żle</span> `x=6` | stała | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not Żle
but Źle
.
istranslation: true | ||
title: Scalacheat | ||
by: Filip Czaplicki | ||
about: Dzięki <a href="http://brenocon.com/">Brendan O'Connor</a>. Ten cheatsheet ma być szybkim podsumowaniem konstrukcji składniowych Scali. Licencjonowany przez Brendan O'Connor pod licencją CC-BY-SA 3.0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe "Podziękowania dla Brendan O'Connor." would be better.
| <span class="label success">Dobrze</span> `(1 to 5).map(2*)`<br> <span class="label important">Źle</span> `(1 to 5).map(*2)` | funkcja anonimowa: związana metoda infiksowa. Możesz użyć także `2*_`. | | ||
| `(1 to 5).map { x => val y=x*2; println(y); y }` | funkcja anonimowa: z bloku zwracane jest ostatnie wyrażenie. | | ||
| `(1 to 5) filter {_%2 == 0} map {_*2}` | funkcja anonimowa: styl potokowy. (lub ponawiasowane). | | ||
| `def compose(g:R=>R, h:R=>R) = (x:R) => g(h(x))` <br> `val f = compose({_*2}, {_-1})` | funkcja anonimowa: aby przekazać kilka bloków musisz ponawiasować. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
funkcja anonimowa: aby przekazać kilka bloków musisz użyć nawiasów.
| `5.+(3); 5 + 3` <br> `(1 to 5) map (_*2)` | lukier składniowy dla operatorów infiksowych. | | ||
| `def sum(args: Int*) = args.reduceLeft(_+_)` | zmienna liczba argumentów funkcji. | | ||
| <span id="packages" class="h2">pakiety</span> | | | ||
| `import scala.collection._` | import z dżokerem. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this one, maybe import wszystkiego z danego pakietu
would be better?
| `var (x,y,z) = (1,2,3)` | przypisanie z podziałem: rozpakowywanie krotki przy pomocy dopasowywania wzorca. | | ||
| <span class="label important">Źle</span>`var x,y,z = (1,2,3)` | ukryty błąd: do każdego przypisana cała krotka. | | ||
| `var xs = List(1,2,3)` | lista (niezmienna). | | ||
| `xs(2)` | indeksowanie za pomocą nawiasów. ([slides](http://www.slideshare.net/Odersky/fosdem-2009-1013261/27)) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slajdy
| `while (x < 5) { println(x); x += 1}` | pętla while. | | ||
| `do { println(x); x += 1} while (x < 5)` | pętla do while. | | ||
| `import scala.util.control.Breaks._`<br>`breakable {`<br>` for (x <- xs) {`<br>` if (Math.random < 0.1) break`<br>` }`<br>`}`| instrukcja przerwania pętli (break). ([slides](http://www.slideshare.net/Odersky/fosdem-2009-1013261/21)) | | ||
| `for (x <- xs if x%2 == 0) yield x*10` _to samo co_ <br>`xs.filter(_%2 == 0).map(_*10)` | zrozumienie pętli for: filtrowanie / mapowanie | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instrukcja for: fultrowanie / mapowanie
and please change zrozumienie
to instrukcja
| `for (i <- 1 to 5) {`<br> `println(i)`<br>`}` | zrozumienie pętli for: iterowanie aż do górnej granicy | | ||
| `for (i <- 1 until 5) {`<br> `println(i)`<br>`}` | zrozumienie pętli for: iterowanie poniżej górnej granicy | | ||
| <span id="pattern_matching" class="h2">pattern matching (dopasowywanie wzorca)</span> | | | ||
| <span class="label success">Dobrze</span> `(xs zip ys) map { case (x,y) => x*y }`<br> <span class="label important">Źle</span> `(xs zip ys) map( (x,y) => x*y )` | używaj słowa kluczowego case w funkcjach w celu dopasowywania wzorca. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
używaj słowa kluczowego case w funkcjach w celu dopasowywania wzorca. (pattern matching)
would be better - since everyone knows what pattern matching is, it will be easier to search for reference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this suggestion. Do you want me to replace something with (pattern matching)
? I've added that phrase at the end.
Thanks ! LGTM from me. Dont know if someone else can take a look too. @SethTisue what do you think? |
thanks Filip & Rafal! |
|
I've added polish translation of cheatsheets page. You can find it here.